<template> 
    <div>
    <ul>
        <li v-for="item in dataList">{{item}}</li> 
    </ul>
    <input v-model="dataInput" v-on:keyup.13="addDataItem()" ></input>
    </div>
</template>

<script>
    export default {
      data () {
        return {
          dataInput: '',
          dataList: [ 'hello world!', 'welcome to use vue.js' ]
        }
      },
      methods: {
        addDataItem () {
          let self = this
          if (!(self.dataInput && self.dataInput.length > 0)) {
            return
          }
          self.dataList.push(self.dataInput)
          self.dataInput = ''
        }
      }
    }
</script>
